//
//  YD_ManagerTool.h
//  ziru
//
//  Created by isu on 16/7/30.
//  Copyright © 2016年 isu. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger,HttpRequestType) {
    /**
     *  get请求
     */
    HttpRequestTypeGet = 0,
    /**
     *  post请求
     */
    HttpRequestTypePost,
    /**
     *  post请求的参数为Json
     */
    HttpRequestTypePostAndJSON
    
};
@interface HcardManagerTool : NSObject
+ (void)requestWithURLString:(NSString *)URLString
                  parameters:(id)parameters
                        type:(HttpRequestType)type
                     success:(void (^)(id))success
                     failure:(void (^)(NSError *))failure;
+ (void)uploadImageWithImage:(UIImage *)image
                        Url :(NSString*)url
                  Dictionary:(NSDictionary *)dictionary
                     success:(void (^)(id))success
                     failure:(void (^)(NSError *))failure;

+ (void)upLoadVideoWithOption:(NSDictionary *)para
                withInferface:(NSString *)requestURL
                    videoPath:(NSString *)videoURL
                uploadSuccess:(void (^)(id sucess))sucess
                uploadFailure:(void (^)(NSError * error))failure
                     progress:(void (^)(NSProgress * progress))progress;


+(void)downLoadWithUrl:(NSString *)requestUrl
               success:(void (^)(id ))success
               failure:(void (^)(NSError * ))failure
              progress:(void (^)(NSProgress * ))progress;


//上传音频
+(void)upLoadAudioWithUrl:(NSString *)requestUrl
              WithOptions:(NSDictionary *)para
            WithSourceUrl:(NSString *)SourceUrl
                  success:(void (^)(id ))success
                  failure:(void (^)(NSError * ))failure
                 progress:(void (^)(NSProgress * ))progress;

@end
